<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Administration page</title>
    </head>
  <body>
    <h1>Administration page</h1>
    <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
    </g:if>
    <br/>
    <h2>Budget</h2>
    <br/>
    <% def a = session.access
    a.refresh()
    %>
    <g:if test="${a.container.budgetLocked}">
      Budget currently locked <br/><br/>
      <g:form action="unlock" method="post">
        <input type="hidden" name="containerId" id="containerId" value="${a.container.id}" />
        <input type="submit" value="Unlock budget"/>
      </g:form>
    </g:if>
    <g:else>
      Budget currently unlocked <br/><br/>
      <g:form action="lock" method="post">
        <input type="hidden" name="containerId" id="containerId" value="${a.container.id}" />
        <input type="submit" value="Lock budget"/>
      </g:form>
    </g:else>
    <br/>
    <h2>Give access rights</h2>
    <br/>
    <g:link controller="access" action="list">Access</g:link>
    <br/>
    <br/>
    <h2>Manage areas</h2>
    <br/>
    <g:link controller="area" action="list">Areas</g:link>
  </body>
</html>
